package com.prj.ufdm.demo.config;

import javax.annotation.Resource;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

import com.prj.ufdm.demo.constant.DemoConstants;

@Configuration
public class InitParamConfig {
	
	@Resource
	private Environment env;
	
	@Bean
	public String initConfigParam() {
		DemoConstants.JOB_SCHEDULE = env.getProperty("job.schedule");
		try {
			DemoConstants.JOB_PERIOD = Long.parseLong(env.getProperty("job.period"));
		}
		catch(Exception er) {
			
		}
		return "";
	}
}
